package com.baidu.videoseries.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;

import com.baidu.videoseries.activity.ContentActivity;
import com.baidu.videoseries.constant.Config;
import com.kvin.toolkit.activity.OnBindInit;
import com.kvin.toolkit.utils.JumpUtils;

/**
 * Created by leiyun on 2018/5/18.
 */
public class BaseFragment extends Fragment implements OnBindInit, View.OnClickListener {

    private boolean isInitialized;
    protected Bundle mBundle;
    protected Intent mIntent;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.isInitialized = false;
    }


    @Override
    public void onStart() {
        super.onStart();
        if (!isInitialized) {
            isInitialized = true;
            initNav();
            init();

        }
    }

    @Override
    public void onClick(View v) {

    }

    @Override
    public void init() {

    }

    @Override
    public void initNav() {

    }

    @Override
    public void initDialog() {

    }

    @Override
    public void loadingData(int pageNum) {

    }


    /**
     * jump
     */
    protected void jump(int index){
        this.mBundle=new Bundle();
        this.mBundle.putInt(Config.Key.INDEX,index);
        JumpUtils.jumpWithParams(getActivity(), ContentActivity.class,mBundle);
    }
}
